package com.tsingtao.springboot2.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

@Slf4j
public class CustomIdGenerator implements IdentifierGenerator {

    @Override
    public Number nextId(Object entity) {
        UUID uuid = UUID.randomUUID();
        int i = uuid.hashCode();
        log.info("生成的主键：{}", i);
        return i;
    }


}
